//
//  DummyDetailViewController.m
//  HideBar
//
//  Created by Naoki TSUTSUI on 10/02/05.
//  Copyright 2010 iphoneworld.jp. All rights reserved.
//

#import "DummyDetailViewController.h"


@implementation DummyDetailViewController

@synthesize displayNavigationBarButton;
@synthesize indexPath;

- (void)dealloc {
  [displayNavigationBarButton release];
  [indexPath release];
  [super dealloc];
}

- (IBAction)displayNavigationBar:(id)sender {
  if (indexPath.section == 0 || indexPath.section == 2) {
    [self.navigationController setNavigationBarHidden:NO animated:YES];
  }
}


- (void)viewDidLoad {
  [super viewDidLoad];
}

- (void)viewWillAppear:(BOOL)animated {
  [super viewWillAppear:animated];
}

- (void)viewDidAppear:(BOOL)animated {
  [super viewDidAppear:animated];
  NSLog(@"indexPath is %d", indexPath.section);
  if (indexPath.section == 0 || indexPath.section == 2) {
    // この場合はアニメーションはNOにすべきだと思います。
    // animatedをYESにして動作を見てみれば分かります ;)
    [self.navigationController setNavigationBarHidden:YES animated:NO];
  } else {
    // 最初から表示したくないときは|viewWillAppear|に書く
    displayNavigationBarButton.hidden = YES;
  }
}

- (void)didReceiveMemoryWarning {
	// Releases the view if it doesn't have a superview.
  [super didReceiveMemoryWarning];
	
	// Release any cached data, images, etc that aren't in use.
}

- (void)viewDidUnload {
	// Release any retained subviews of the main view.
	// e.g. self.myOutlet = nil;
  self.displayNavigationBarButton = nil;
  self.indexPath = nil;
}
@end
